//
//  CCSDChouseSortCell.m
//  Ccsd_user
//
//  Created by 张露杰 on 18/2/24.
//  Copyright © 2018年 张露杰. All rights reserved.
//

#import "CCSDChouseKindCell.h"

@implementation CCSDChouseKindCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        self.selectionStyle = 0;
    }
    return self;
}

-(void)loadCellNewWithData:(NSDictionary *)data isSelect:(BOOL)isSelect
{
    for (UIView *view in self.contentView.subviews) {
        [view removeFromSuperview];
    }
    
    UILabel *label = [TomamaUI createLabel:CGRectMake(19*screenW_6, 0, [TomamaUI getStringWeithtWith:data[@"name"] andHeigth:14*screenW_6 andFont:[UIFont systemFontOfSize:14*screenW_6]], 14*screenW_6) textAligment:0 font:[UIFont systemFontOfSize:14*screenW_6] textColor:TextBlack text:data[@"name"]];
    [self.contentView addSubview:label];
    label.center = CGPointMake(label.center.x, 20*screenW_6);
    
    if (isSelect) {
        UIImageView *imageV = [TomamaUI createImageView:CGRectMake(SCREENW - 28.5*screenW_6, 0, 12.5*screenW_6, 8.5*screenW_6) backGroundImageV:@"Goods_chouse"];
        [self.contentView addSubview:imageV];
        imageV.center = CGPointMake(imageV.center.x, 20*screenW_6);
        label.textColor = mainColor;
    }
    
    UIView *lineView = [[UIView alloc]initWithFrame:CGRectMake(19*screenW_6, 40*screenW_6 - 1, SCREENW - 19*screenW_6, 1)];
    lineView.backgroundColor = LineColor;
    [self.contentView addSubview:lineView];
}

@end
